package com.alphaking.main;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.jasper.tagplugins.jstl.core.ForEach;

import com.alphaking.Jdbc.JdbcComments;
import com.alphaking.Jdbc.JdbcReply;
import com.alphaking.Jdbc.JdbcShare;
import com.alphaking.Jdbc.JdbcUtils;
import com.alphaking.bean.Comments;
import com.alphaking.bean.Reply;
import com.alphaking.bean.Share;
import com.alphaking.bean.Upvote;
import com.alphaking.bean.User;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class Main {

	public static void main(String[] args) {

		JdbcUtils.getConnection();
		// Share share = new Share();
		// share.setTitle("jsp");
		// share.setShareContent("后台");
		// share.setShareId(5);
		// List<String> list = new ArrayList<>();
		// list.add("100");
		// list.add("101");
		// list.add("102");
		// share.setImageAddress(list);
		// JdbcShare.add(share, "caicai");
		// share.setShareContent("好帅的");
		// JdbcShare.update(share);
		// JSONObject jsonObject = JSONObject.fromObject(share);
		// System.out.println(jsonObject);
		// List<Reply> replys = JdbcReply.getReplys(2);
		// for (Reply reply : replys) {
		// System.out.println(reply.getReplyer());
		// System.out.println(reply.getTouser());
		// System.out.println(reply.getReply_content());
		// }
		JSONArray jsonObject = JSONArray.fromObject(JdbcShare.query(6));
		System.out.println(jsonObject.toString());
	}
}
